﻿@model AntUnion.FrameWork.Model.Models.Mt5User

@{
    ViewData["Title"] = "CRMAccountInfo";
    Layout = "~/Areas/Console/Views/Shared/_Layout.cshtml";
}
@section head{
    <script type="text/javascript">
        var renderTable;
        var setSelectData;
        var userType = 0;
        var capitalFlowTable;
        var orderHistoryTable;
        var openPositionsTable;
        var limitOrderTable;

        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            treetable: 'treetable-lay/treetable',
            index: 'lib/index'
        }).use(['table', 'treetable', 'index', 'laydate', 'form', 'util'], function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , table = layui.table
                , util = layui.util
                , element = layui.element
                , laydate = layui.laydate;
            element.render();
            element.on('tab(component-tabs-brief)', function (obj) {
                userType = obj.index;
                switch (obj.index) {
                    case 1: capitalFlowTable(); break;
                    case 2: limitOrderTable(); break;
                    case 3: openPositionsTable(); break;
                    case 4: orderHistoryTable(); break;
                }
            });

            //日期范围
            laydate.render({
                elem: '#creationTime'
                , range: true
            });
            laydate.render({
                elem: '#creationTimeMT5Deal'
                , range: true
            });

            $.getJSON("/Console/MT5Users/GetMTGroupListJson", function (result) {
                let plat = result.data;
                $('#MTgroups').append(new Option(top.lang.pleaseSelect, ""));
                plat.forEach(function (v) {
                    $('#MTgroups').append(new Option(v.groupName, v.groupName));
                });
                $("#MTgroups").val("@Model.Group");
                layui.form.render("select");
            });

            $.getJSON("/Console/CRMGroup/GetListJson?page=0&limit=0", function (result) {
                let plat = result.data;
                $('#accountGroup').append(new Option(top.lang.pleaseSelect, ""));
                plat.forEach(function (v) {
                    $('#accountGroup').append(new Option(v.names, v.id));
                });
                $("#accountGroup").val("@ViewBag.crmGroup");
                layui.form.render("select");
            });

            $.getJSON("/Console/Laverage/GetListJson", function (result) {
                let plat = result.data;
                $('#laverage').append(new Option(top.lang.pleaseSelect, ""));
                plat.forEach(function (v) {
                    $('#laverage').append(new Option(v.name, v.laverages));
                });
                $("#laverage").val("@Model.Laverage");
                layui.form.render("select");
            });

            /**多语言初始化 */
            top.SetListPageLanguage(layui);
            $.getJSON("/Console/Roles/GetListJson?userType=1", function (result) {
                let plat = result.data;
                for (var key in top.lang) {
                    if (top.lang.hasOwnProperty(key)) {
                        if (key === "none") {
                            var text = top.lang[key];
                            $('#roles').append(new Option(text, ""));
                        }
                    }
                }
                plat.forEach(function (v) {
                    for (var key in top.lang) {
                        if (top.lang.hasOwnProperty(key)) {
                            if (key === v.remark) {
                                var text = top.lang[key];
                                $('#roles').append(new Option(text, v.id));
                            }
                        }
                    }
                });
                if ($('#hiddenRoles').val() != "0") {
                    $('#roles').val($('#hiddenRoles').val());
                }
                layui.form.render("select");
            });

            /*账户详情 开始 */
            form.on('submit(accountEdit)', function (data) {
                $('#Name').removeAttr('disabled');
                $('#crmUp').removeAttr('disabled');
                $('#MTgroups').attr("disabled", false);
                $('#accountGroup').attr("disabled", false);
                $('#laverage').attr("disabled", false);
                form.render();
                $('#accountEdit').addClass('layui-hide');
                $('#accountConfirmBtn').removeClass('layui-hide');
                $('#accountCancel').removeClass('layui-hide');
            });

            form.on('submit(slectCRMUp)', function (data) {
                top.OpenPageByKey(layui, "accountOwnership", 2, '1000px', '600px', '/Console/CRMAccount/SlectCRMUp');
            });

            form.on('submit(accountCancel)', function (data) {
                $('#Name').prop('disabled', true);
                $('#crmUp').prop('disabled', true);
                $('#MTgroups').attr('disabled', true);
                $('#accountGroup').attr("disabled", true);
                $('#laverage').attr("disabled", true);
                form.render();
                $('#accountEdit').removeClass('layui-hide');
                $('#accountConfirmBtn').addClass('layui-hide');
                $('#accountCancel').addClass('layui-hide');
                location.reload();
            });

            form.on('submit(accountConfirmBtn)', function (data) {
                if (!$('#MTgroups option:selected').val()) {                    
                    /**提示语弹框 */
                    top.AlertByKey(layui, "pleaseSelectMTGroup", 0);
                    return;
                }
                $.ajax({
                    type: "POST",
                    url: "/Console/MT5Users/EditAccountInfo",
                    data: {
                        "Login": $('#Login').val(),
                        "Name": $('#lastname').val(),
                        "accountOwnership": $('#crmUpId').val(),
                        "MTgroups": $('#MTgroups option:selected').val(),
                        "accountGroup": $('#accountGroup option:selected').val(),
                        "laverage": $("#laverage option:selected").val()
                    },
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, "submitSuccess", 6, 1000, function () {
                                parent.layer.close(parentFrameIndex);
                                parent.renderTable();
                            });
                            $('#Name').prop('disabled', true);
                            $('#crmUp').prop('disabled', true);
                            $('#MTgroups').attr('disabled', true);
                            $('#accountGroup').attr("disabled", true);
                            $('#laverage').attr("disabled", true);
                            form.render();
                            $('#accountEdit').removeClass('layui-hide');
                            $('#accountConfirmBtn').addClass('layui-hide');
                            $('#accountCancel').addClass('layui-hide');
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, "submitFail", 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });
            /*账户详情 结束 */

            /*账户操作 开始 */
            /*账户操作 结束 */

            /*账户权限 开始 */
            /*账户权限 结束 */

            /*资金流水 开始 */

            $.getJSON("/Console/Codes/GetListJson?page=0&limit=0&type=mt5OperationMode", function (result) {
                $('#operationType').append(new Option(top.lang.pleaseSelect, ""));
                let plat = result.data;
                plat.forEach(function (v) {
                    for (var key in top.lang) {
                        if (top.lang.hasOwnProperty(key)) {
                            if (key === v.remark) {
                                var text = top.lang[key];
                                $('#operationType').append(new Option(text, v.remark));
                            }
                        }
                    }
                });
                layui.form.render("select");
            });

            capitalFlowTable = function () {
                table.render({
                    elem: '#table-datalist-mt5Transactions'
                    , id: "mt5TransactionsSearch"
                    , url: '/Console/MT5Transactions/GetListJson'
                    , toolbar: false
                    , defaultToolbar: false
                    , limit: 20
                    , title: '数据表'
                    , where: {
                        login: $("#Login").val()
                    }
                    , cols: [[
                        { field: 'index', title: '序号', type: 'numbers', width: 60, templet: '#mt5TransactionsIndex' }
                        , {
                            field: 'fullName', title: '姓名', templet: function (res) {
                                return res.fullName;
                            }
                        }
                        , {
                            field: 'CRMAccount', title: 'CRM账户', templet: function (res) {
                                return res.loginName;
                            }
                        }
                        , {
                            field: 'tradingAccountNo', title: '交易账号', width: 100, templet: function (res) {
                                return res.tradingAccount;
                            }
                        }
                        , {
                            field: 'operationMode', title: '操作方式', width: 100, templet: function (res) {
                                return '<span lay-event="' + res.operationType + '"></span>';
                            }
                        }
                        , { field: 'changeAmount', title: '变动金额', width: 120 }
                        , { field: 'receivedAmount', title: '到账金额', width: 120 }
                        , { field: 'commission', title: '手续费', width: 110 }
                        , {
                            field: 'changeTime', title: '变动时间', width: 160, templet: function (res) {
                                return res.creationTime;
                            }
                        }
                        , {
                            field: 'orderNumber', title: '订单号', width: 100, templet: function (res) {
                                return res.transactionOrderNumber;
                            }
                        }
                        , { field: 'aduitUser', title: '审核员' }
                        , { field: 'aduitTime', title: '审核时间' }
                        , { field: 'remark', title: '备注' }
                    ]]
                    , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                    , done: function (res) {
                        if (res.count == 0) {
                            $(".layui-table-main").html('<div class="layui-none">' + top.lang.noData + '</div>');
                        }
                        layer.closeAll('loading');
                        /**多语言初始化 */
                        top.SetListPageLanguage(layui);
                    }
                });
            };
            form.on('submit(mt5TransactionsSearch)', function (data) {
                //执行重载
                table.reload('mt5TransactionsSearch', {
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                    , where: {
                        login: $("#Login").val(),
                        orderNumber: $("#orderNumber").val(),
                        operationType: $("#operationType").val(),
                        creationTime: $("#creationTime").val()
                    }
                });
            });
            //重置
            form.on('submit(mt5TransactionsResetting)', function (data) {
                //执行重载
                $("#divMT5Transactions input").each(function () {
                    $(this).val("");
                });
                $('#operationType').val("");
                layui.form.render("select");
            });
            //刷新
            form.on('submit(mt5TransactionsRefresh)', function (data) {
                //执行重载
                table.reload('mt5TransactionsSearch', {
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                    , where: {
                        login: $("#Login").val(),
                        orderNumber: $("#orderNumber").val(),
                        operationType: $("#operationType").val(),
                        creationTime: $("#creationTime").val()
                    }
                });
            });
            /*资金流水 结束 */

            /*限价订单 开始 */
            $.getJSON("/Console/MT5Deal/GetActions", function (result) {
                let plat = result.data;
                $('#transactionTypeMT5Deal').append(new Option(top.lang.pleaseSelect, ""));
                plat.forEach(function (v) {
                    $('#transactionTypeMT5Deal').append(new Option(v, v));
                });
                layui.form.render("select");
            });
            $.getJSON("/Console/MT5Deal/GetSymbols", function (result) {
                let plat = result.data;
                $('#tradingVarietyMT5Deal').append(new Option(top.lang.pleaseSelect, ""));
                plat.forEach(function (v) {
                    $('#tradingVarietyMT5Deal').append(new Option(v, v));
                });
                layui.form.render("select");
            });
            orderHistoryTable = function () {
                table.render({
                    elem: '#table-datalist-MT5Deal'
                    , id: "MT5DealSearch"
                    , url: '/Console/MT5Deal/GetListJson'
                    , toolbar: false
                    , defaultToolbar: false
                    , limit: 20
                    , title: '数据表'
                    , where: {
                        login: $("#Login").val()
                    }
                    , cols: [[
                        { field: 'index', title: '序号', type: 'numbers', width: 60, templet: '#MT5DealIndex' }
                        //, {
                        //    field: 'fullNameAndId', title: '姓名/账户ID', templet: function (res) {
                        //        return res.fullName;
                        //    }
                        //}
                        //, { field: 'tradingAccount', title: '交易账号' }
                        , {
                            field: 'transactionOrderNumber', title: '交易订单号', templet: function (res) {
                                return res.orderNumber;
                            }
                        }
                        , { field: 'tradingVariety', title: '交易品种' }
                        , { field: 'transactionType', title: '交易类型' }
                        , {
                            field: 'tradingHours', title: '交易时间', width: 180, templet: function (res) {
                                if (res.timeSetup <= 0) {
                                    return ""
                                }
                                else {
                                    return formatTime(res.tradingHours, 'Y-M-D h:m:s')
                                }
                            }
                        }
                        , { field: 'transactionPrice', title: '交易价格' }
                        , { field: 'volume', title: '交易量' }
                        , { field: 'profit', title: '利润' }
                        , { field: 'storage', title: '库存' }
                        , { field: 'profitAndLoss', title: '盈亏' }
                        , { field: 'pricePosition', title: '平仓价格' }
                    ]]
                    , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                    , done: function (res) {
                        if (res.count == 0) {
                            $(".layui-table-main").html('<div class="layui-none">' + top.lang.noData + '</div>');
                        }
                        layer.closeAll('loading');
                        /**多语言初始化 */
                        top.SetListPageLanguage(layui);
                    }
                });
            };
            form.on('submit(MT5DealSearch)', function (data) {
                //执行重载
                table.reload('MT5DealSearch', {
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                    , where: {
                        login: $("#Login").val(),
                        orderNumber: $("#orderNumberMT5Deal").val(),
                        transactionType: $("#transactionTypeMT5Deal").val(),
                        tradingVariety: $("#tradingVarietyMT5Deal").val()
                    }
                });
            });
            //重置
            form.on('submit(MT5DealResetting)', function (data) {
                //执行重载
                $("#divMT5Deal input").each(function () {
                    $(this).val("");
                });
                $('#transactionTypeMT5Deal').val("");
                $('#tradingVarietyMT5Deal').val("");
                layui.form.render("select");
            });
            //刷新
            form.on('submit(MT5DealRefresh)', function (data) {
                //执行重载
                table.reload('MT5DealSearch', {
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                    , where: {
                        login: $("#Login").val(),
                        orderNumber: $("#orderNumberMT5Deal").val(),
                        transactionType: $("#transactionTypeMT5Deal").val(),
                        tradingVariety: $("#tradingVarietyMT5Deal").val()
                    }
                });
            });
            /*限价订单 结束 */

            /*持仓订单 开始 */
            $.getJSON("/Console/MT5Position/GetActions", function (result) {
                let plat = result.data;
                $('#transactionTypeMT5Position').append(new Option(top.lang.pleaseSelect, ""));
                plat.forEach(function (v) {
                    $('#transactionTypeMT5Position').append(new Option(v, v));
                });
                layui.form.render("select");
            });
            $.getJSON("/Console/MT5Position/GetSymbols", function (result) {
                let plat = result.data;
                $('#tradingVarietyMT5Position').append(new Option(top.lang.pleaseSelect, ""));
                plat.forEach(function (v) {
                    $('#tradingVarietyMT5Position').append(new Option(v, v));
                });
                layui.form.render("select");
            });

            openPositionsTable = function () {
                table.render({
                    elem: '#table-datalist-MT5Position'
                    , id: "MT5PositionSearch"
                    , url: '/Console/MT5Position/GetListJson'
                    , toolbar: false
                    , defaultToolbar: false
                    , limit: 20
                    , title: '数据表'
                    , where: {
                        login: $("#Login").val()
                    }
                    , cols: [[
                        { field: 'index', title: '序号', type: 'numbers', width: 60, templet: '#MT5PositionIndex' }
                        , { field: 'orderNumber', title: '订单号' }
                        , { field: 'tradingVariety', title: '交易品种' }
                        , { field: 'transactionType', title: '交易类型' }
                        , { field: 'priceOpen', title: '开仓价格' }
                        , { field: 'priceCurrent', title: '当前价格' }
                        , { field: 'profitAndLoss', title: '盈亏' }
                        , { field: 'storage', title: '库存' }
                        , {
                            field: 'timeCreateMsc', title: '开仓时间', width: 180, templet: function (res) {
                                if (res.timeCreate <= 0) {
                                    return ""
                                }
                                else {
                                    return formatTime(res.timeCreate, 'Y-M-D h:m:s')
                                }
                            }
                        }
                    ]]
                    , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                    , done: function (res) {
                        if (res.count == 0) {
                            $(".layui-table-main").html('<div class="layui-none">' + top.lang.noData + '</div>');
                        }
                        layer.closeAll('loading');
                        /**多语言初始化 */
                        top.SetListPageLanguage(layui);
                    }
                });
            };
            form.on('submit(MT5PositionSearch)', function (data) {
                //执行重载
                table.reload('MT5PositionSearch', {
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                    , where: {
                        login: $("#Login").val(),
                        orderNumber: $("#orderNumberMT5Position").val(),
                        transactionType: $("#transactionTypeMT5Position").val(),
                        tradingVariety: $("#tradingVarietyMT5Position").val()
                    }
                });
            });
            //重置
            form.on('submit(MT5PositionResetting)', function (data) {
                //执行重载
                $("#divMT5Position input").each(function () {
                    $(this).val("");
                });
                $('#transactionTypeMT5Position').val("");
                $('#tradingVarietyMT5Position').val("");
                layui.form.render("select");
            });
            //刷新
            form.on('submit(MT5PositionRefresh)', function (data) {
                //执行重载
                table.reload('MT5PositionSearch', {
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                    , where: {
                        login: $("#Login").val(),
                        orderNumber: $("#orderNumberMT5Position").val(),
                        transactionType: $("#transactionTypeMT5Position").val(),
                        tradingVariety: $("#tradingVarietyMT5Position").val()
                    }
                });
            });
            /*持仓订单 结束 */

            /*交易历史 开始 */
            $.getJSON("/Console/MT5Order/GetActions", function (result) {
                let plat = result.data;
                $('#transactionTypeMT5Order').append(new Option(top.lang.pleaseSelect, ""));
                plat.forEach(function (v) {
                    $('#transactionTypeMT5Order').append(new Option(v, v));
                });
                layui.form.render("select");
            });
            $.getJSON("/Console/MT5Order/GetSymbols", function (result) {
                let plat = result.data;
                $('#tradingVarietyMT5Order').append(new Option(top.lang.pleaseSelect, ""));
                plat.forEach(function (v) {
                    $('#tradingVarietyMT5Order').append(new Option(v, v));
                });
                layui.form.render("select");
            });

            limitOrderTable = function () {
                table.render({
                    elem: '#table-datalist-MT5Order'
                    , id: "MT5OrderSearch"
                    , url: '/Console/MT5Order/GetListJson'
                    , toolbar: false
                    , defaultToolbar: false
                    , limit: 20
                    , title: '数据表'
                    , where: {
                        login: $("#Login").val()
                    }
                    , cols: [[
                        { field: 'index', title: '序号', type: 'numbers', width: 60, templet: '#MT5OrderIndex' }
                        , {
                            field: 'transactionOrderNumber', title: '交易订单号', templet: function (res) {
                                return res.orderNumber;
                            }
                        }
                        , { field: 'tradingVariety', title: '交易品种' }
                        , {
                            field: 'timeSetupMsc', title: '下单时间', width: 180, templet: function (res) {
                                if (res.timeSetup <= 0) {
                                    return ""
                                }
                                else {
                                    return formatTime(res.timeSetupMsc, 'Y-M-D h:m:s')
                                }
                            }
                        }
                        , { field: 'transactionType', title: '交易类型' }
                        , { field: 'volume', title: '交易量' }
                        , { field: 'priceOrder', title: '订单价格' }
                        , { field: 'priceSl', title: '止损' }
                        , { field: 'priceTp', title: '止盈' }
                        , { field: 'priceCurrent', title: '当前价格' }
                        , {
                            field: 'timeExpiration', title: '到期', width: 180, templet: function (res) {
                                if (res.timeExpiration <= 0) {
                                    return ""
                                }
                                else {
                                    return formatTime(res.timeExpiration, 'Y-M-D h:m:s')
                                }
                            }
                        }
                    ]]
                    , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                    , done: function (res) {
                        if (res.count == 0) {
                            $(".layui-table-main").html('<div class="layui-none">' + top.lang.noData + '</div>');
                        }
                        layer.closeAll('loading');
                        /**多语言初始化 */
                        top.SetListPageLanguage(layui);
                    }
                });
            };
            form.on('submit(MT5OrderSearch)', function (data) {
                //执行重载
                table.reload('MT5OrderSearch', {
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                    , where: {
                        login: $("#Login").val(),
                        orderNumber: $("#orderNumberMT5Order").val(),
                        transactionType: $("#transactionTypeMT5Order").val(),
                        tradingVariety: $("#tradingVarietyMT5Order").val()
                    }
                });
            });
            //重置
            form.on('submit(MT5OrderResetting)', function (data) {
                //执行重载
                $("#divMT5Order input").each(function () {
                    $(this).val("");
                });
                $('#transactionTypeMT5Order').val("");
                $('#tradingVarietyMT5Order').val("");
                layui.form.render("select");
            });
            //刷新
            form.on('submit(MT5OrderRefresh)', function (data) {
                //执行重载
                table.reload('MT5OrderSearch', {
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                    , where: {
                        login: $("#Login").val(),
                        orderNumber: $("#orderNumberMT5Order").val(),
                        transactionType: $("#transactionTypeMT5Order").val(),
                        tradingVariety: $("#tradingVarietyMT5Order").val()
                    }
                });
            });
            /*交易历史 结束 */
        });
    </script>
}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
                        <ul class="layui-tab-title">
                            <li lay-event="accountDetails" class="layui-this">账户详情</li>
                            <li lay-event="capitalFlow">资金流水</li>
                            <li lay-event="limitOrder">挂单交易</li>
                            <li lay-event="openPositions">持仓订单</li>
                            <li lay-event="orderHistory">交易历史</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form">
                                    <div class="layui-row layui-col-space10 layui-form-item">
                                        <div class="layui-col-md5">
                                            <label class="layui-form-label" lay-event="fullName">姓</label>
                                            <div class="layui-input-block">
                                                <input type="text" id="Name" name="Name" placeholder="fullName" value="@Model.Name" disabled="disabled" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-col-md5">
                                            <label class="layui-form-label" lay-event="tradingAccount">交易账号</label>
                                            <div class="layui-input-block">
                                                <div class="layui-form-mid layui-word-aux">@Model.Login</div>
                                                @Html.HiddenFor(m => m.Login)
                                            </div>
                                        </div>
                                        @*<div class="layui-col-md5">
                                                <label class="layui-form-label" lay-event="accountType">账户类型</label>
                                                <div class="layui-input-block">
                                                    @if (Model.Type == 0)
                                                    {
                                                        <span class="layui-badge layui-bg-blue" lay-event="realAccount">真实</span>
                                                    }
                                                    else
                                                    {
                                                        <span class="layui-badge layui-bg-cyan" lay-event="simulatedAccount">模拟</span>
                                                    }
                                                </div>
                                            </div>*@
                                        <div class="layui-col-md5">
                                            <label class="layui-form-label" lay-event="server">服务器</label>
                                            <div class="layui-input-block">
                                                <div class="layui-form-mid layui-word-aux">@Model.Server</div>
                                            </div>
                                        </div>
                                        <div class="layui-col-md5">
                                            <label class="layui-form-label" lay-event="accountOwnership">账号归属</label>
                                            <div class="layui-input-inline">
                                                <input type="text" id="crmUp" name="crmUp" placeholder="accountOwnership" value="@ViewBag.crmUser" disabled="disabled" class="layui-input">
                                                <input id="crmUpId" name="crmUpId" type="hidden" value="@Model.CrmId" />
                                            </div>
                                            <button id="slectCRMUp" name="slectCRMUp" lay-event="slectCRMUp" lay-submit lay-filter="slectCRMUp" class="layui-btn layui-btn-primary layui-border-blue" style="padding:0 5px;margin-right:10px">选择</button>
                                        </div>
                                        <div class="layui-col-md5">
                                            <label class="layui-form-label"><cite style="color:red">&nbsp;&nbsp;*&nbsp;&nbsp;</cite><span lay-event="MTgroups">组别</span></label>
                                            <div class="layui-input-block">
                                                <select name="MTgroups" id="MTgroups" disabled>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-md5">
                                            <label class="layui-form-label"><span lay-event="accountGroup">组别</span></label>
                                            <div class="layui-input-block">
                                                <select name="accountGroup" id="accountGroup" disabled>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-md5">
                                            <label class="layui-form-label"><cite style="color:red">&nbsp;&nbsp;*&nbsp;&nbsp;</cite><span lay-event="laverage">杠杆</span></label>
                                            <div class="layui-input-block">
                                                <select name="laverage" id="laverage" disabled>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-md5">
                                            <label class="layui-form-label" lay-event="registrationTime">注册时间</label>
                                            <div class="layui-input-block">
                                                <div class="layui-form-mid layui-word-aux">@Model.CreateDate</div>
                                            </div>
                                        </div>
                                        @*<div class="layui-col-md5">
                                                <label class="layui-form-label" lay-event="credit">信用额</label>
                                                <div class="layui-input-block">
                                                    <div class="layui-form-mid layui-word-aux">@Model.Credit</div>
                                                </div>
                                            </div>*@
                                        <div class="layui-col-md5">
                                            <label class="layui-form-label" lay-event="MT5balance">余额</label>
                                            <div class="layui-input-block">
                                                <div class="layui-form-mid layui-word-aux">@ViewBag.balance</div>
                                            </div>
                                        </div>
                                        @*<div class="layui-col-md5">
                                                <label class="layui-form-label" lay-event="netValue">净值</label>
                                                <div class="layui-input-block">
                                                    @if (Model.EquityPrevDay != null)
                                                    {
                                                        <div class="layui-form-mid layui-word-aux">@Model.EquityPrevDay</div>
                                                    }
                                                    else
                                                    {
                                                        <div class="layui-form-mid layui-word-aux">0.00</div>
                                                    }
                                                </div>
                                            </div>*@
                                    </div>
                                </div>
                                <div class="layui-input-block">
                                    <button class="layui-btn" id="accountEdit" lay-event="edit" lay-submit lay-filter="accountEdit">编辑</button>
                                    <button class="layui-btn layui-hide" id="accountConfirmBtn" lay-event="confirmBtn" lay-submit lay-filter="accountConfirmBtn">确认</button>
                                    <button class="layui-btn layui-btn-primary layui-hide" id="accountCancel" lay-event="cancel" lay-submit lay-filter="accountCancel">取消</button>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                @*<blockquote class="layui-elem-quote" lay-event="delayPrompt">此页面的数据会有稍许延时。即时的数据，请稍等1-2分钟后刷新页面查询。</blockquote>*@
                                <div class="layui-table-tool layui-form" style="padding:20px 0">
                                    <div id="divMT5Transactions" class="layui-row layui-col-space10 layui-form">
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="operationMode">操作方式</label>
                                            <div class="layui-input-block">
                                                <select name="operationType" id="operationType">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="orderNumber">订单号</label>
                                            <div class="layui-input-block">
                                                <input type="text" id="orderNumber" name="orderNumber" placeholder="orderNumber" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="changeTime">变动时间</label>
                                            <div class="layui-input-block">
                                                <input type="text" id="creationTime" name="creationTime" placeholder="changeTime" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-form-item" style="text-align:center;">
                                            <button class="layui-btn" lay-event="search" lay-submit lay-filter="mt5TransactionsSearch">搜索</button>
                                            <button class="layui-btn layui-btn-warm" lay-submit="" lay-filter="mt5TransactionsResetting" lay-event="resetting">重置</button>
                                            <button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="mt5TransactionsRefresh" lay-event="refresh">刷新</button>
                                        </div>
                                    </div>
                                </div>
                                <script type="text/html" id="mt5TransactionsIndex">
                                    {{d.LAY_TABLE_INDEX+1}}
                                </script>
                                <table class="layui-hide" id="table-datalist-mt5Transactions" lay-filter="table-datalist-mt5Transactions"></table>
                            </div>
                            <div class="layui-tab-item">
                                <blockquote class="layui-elem-quote" lay-event="delayPrompt">此页面的数据会有稍许延时，最新数据请在MT5端进行获取查询</blockquote>
                                <div id="divMT5Order" class="layui-table-tool layui-form" style="padding:20px 0">
                                    <div class="layui-row layui-col-space10 layui-form">
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="transactionOrderNumber">订单号</label>
                                            <div class="layui-input-block">
                                                <input type="text" id="orderNumberMT5Order" name="orderNumberMT5Order" placeholder="transactionOrderNumber" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="transactionType">交易类型</label>
                                            <div class="layui-input-block">
                                                <select name="transactionTypeMT5Order" id="transactionTypeMT5Order">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="tradingVariety">交易品种</label>
                                            <div class="layui-input-block">
                                                <select name="tradingVarietyMT5Order" id="tradingVarietyMT5Order">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-form-item" style="text-align:center;">
                                            <div class="layui-input-block">
                                                <button class="layui-btn" lay-event="search" lay-submit lay-filter="MT5OrderSearch">搜索</button>
                                                <button class="layui-btn layui-btn-warm" lay-submit="" lay-filter="MT5OrderResetting" lay-event="resetting">重置</button>
                                                <button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="MT5OrderRefresh" lay-event="refresh">刷新</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <script type="text/html" id="MT5OrderIndex">
                                    {{d.LAY_TABLE_INDEX+1}}
                                </script>
                                <table class="layui-hide" id="table-datalist-MT5Order" lay-filter="table-datalist-MT5Order"></table>
                            </div>
                            <div class="layui-tab-item">
                                <blockquote class="layui-elem-quote" lay-event="delayPrompt">此页面的数据会有稍许延时，最新数据请在MT5端进行获取查询</blockquote>
                                <div class="layui-table-tool layui-form" style="padding:20px 0">
                                    <div id="divMT5Position" class="layui-row layui-col-space10 layui-form">
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="orderNumber">订单号</label>
                                            <div class="layui-input-block">
                                                <input type="text" id="orderNumberMT5Position" name="orderNumberMT5Position" placeholder="orderNumber" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="transactionType">交易类型</label>
                                            <div class="layui-input-block">
                                                <select name="transactionTypeMT5Position" id="transactionTypeMT5Position">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="tradingVariety">交易品种</label>
                                            <div class="layui-input-block">
                                                <select name="tradingVarietyMT5Position" id="tradingVarietyMT5Position">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-form-item" style="text-align:center;">
                                            <div class="layui-input-block">
                                                <button class="layui-btn" lay-event="search" lay-submit lay-filter="MT5PositionSearch">搜索</button>
                                                <button class="layui-btn layui-btn-warm" lay-submit="" lay-filter="MT5PositionResetting" lay-event="resetting">重置</button>
                                                <button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="MT5PositionRefresh" lay-event="refresh">刷新</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <script type="text/html" id="MT5PositionIndex">
                                    {{d.LAY_TABLE_INDEX+1}}
                                </script>
                                <table class="layui-hide" id="table-datalist-MT5Position" lay-filter="table-datalist-MT5Position"></table>
                            </div>
                            <div class="layui-tab-item">
                                <blockquote class="layui-elem-quote" lay-event="delayPrompt">此页面的数据会有稍许延时，最新数据请在MT5端进行获取查询</blockquote>
                                <div class="layui-table-tool layui-form" style="padding:20px 0">
                                    <div id="divMT5Deal" class="layui-row layui-col-space10 layui-form">
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="orderNumber">订单号</label>
                                            <div class="layui-input-block">
                                                <input type="text" id="orderNumberMT5Deal" name="orderNumberMT5Deal" placeholder="orderNumber" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="transactionType">交易类型</label>
                                            <div class="layui-input-block">
                                                <select name="transactionTypeMT5Deal" id="transactionTypeMT5Deal">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3">
                                            <label class="layui-form-label" lay-event="tradingVariety">交易品种</label>
                                            <div class="layui-input-block">
                                                <select name="tradingVarietyMT5Deal" id="tradingVarietyMT5Deal">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-form-item" style="text-align:center;">
                                            <div class="layui-input-block">
                                                <button class="layui-btn" lay-event="search" lay-submit lay-filter="MT5DealSearch">搜索</button>
                                                <button class="layui-btn layui-btn-warm" lay-submit="" lay-filter="MT5DealResetting" lay-event="resetting">重置</button>
                                                <button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="MT5DealRefresh" lay-event="refresh">刷新</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <script type="text/html" id="MT5DealIndex">
                                    {{d.LAY_TABLE_INDEX+1}}
                                </script>
                                <table class="layui-hide" id="table-datalist-MT5Deal" lay-filter="table-datalist-MT5Deal"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

